// csr-auth模块AuthController
import csrAxios from "@/request";

const modelUrl = "/csr-auth/auth";

/**
 * 登录
 * @param params
 */
export const login = async (params: any) => {
  const res = await csrAxios.request({
    url: modelUrl + "/login",
    method: "post",
    data: params,
  });
  return res;
};

/**
 * 支付宝登录
 * @param params
 */
export const zfbLogin = async (params: any) => {
  const res = await csrAxios.request({
    url: modelUrl + "/zfbLogin",
    headers: {
      isToken: false,
    },
    method: "post",
    data: params,
  });
  return res;
};

/**
 * 获取用户
 * @param params
 */
export const getCurrentUser = async (params: string) => {
  return await csrAxios.request({
    url: modelUrl + "/getCurrentUser?token=" + params,
    headers: {
      isToken: false,
    },
    method: "get",
  });
};
